<template>
  <footer class="footer">
      <span class="todo-count"><strong>{{ sum }}</strong>剩余</span>
      <ul class="filters">
        <li>
          <a :class="{selected: type === 'all'}" @click="changeList('all')" href="#/">全部</a>
        </li>
        <li>
          <a :class="{selected: type === 'active'}" @click="changeList('active')" href="#/active">进行中</a>
        </li>
        <li>
          <a :class="{selected: type === 'completed'}" @click="changeList('completed')" href="#/completed">已完成</a>
        </li>
      </ul>
      <button class="clear-completed" v-show="showClearBtn" @click="delAll">清除已完成</button>
    </footer>
</template>
 
<script>
export default {
  name: "MytodoListFooter",
  components: {},
  props: {
    sum: {
      type: Number,
      required: true,
    },

    showClearBtn: {
       type: Boolean,
       required: true,
    },
    type: {
      type: String,
      required: true,
    }
  },
  data() {
    return {};
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    delAll() {
      this.$emit('x')
    },

    // 改变状态栏
    changeList(value) {
      this.$emit('changeList', value)
    }
  }
};
</script>

<style scoped>
     
</style>